gmms_data = cell(8, 5);
dev_error = zeros(8, 5);
test_error = zeros(8, 5);

for i = 1 : 5
    for j = 1 : 8
        gmms_data{j, i} = gmm_train(Xdata_all{j}, ydata, i);
    end
end

for i = 1 : 5
    for j = 1 : 8
        fprintf('dev set: %d mixtures, feature set %d\n', i, j);
        ytemp = gmm_classify(Xdev_all{j}, gmms_data{j, i});
        dev_error(j, i) = calc_error(ytemp, ydev);
    end
end

for i = 1 : 5
    for j = 1 : 8
        fprintf('test set: %d mixtures, feature set %d\n', i, j);
        ytemp = gmm_classify(Xtest_all{j}, gmms_data{j, i});
        test_error(j, i) = calc_error(ytemp, ytest);
    end
end